package cn.edu.scau.cmi.dengzejun.chapter09;

import java.util.*;

public class Example9_12 {
	public static void main(String agrs[]) {
		StringBuffer str = new StringBuffer();
		str.append("Hello!");
		System.out.println("str = " + str);
		System.out.println("length is "+str.length());
		System.out.println("capacity is "+str.capacity());
		str.setCharAt(0, 'w');
		str.setCharAt(1, 'e');
		System.out.println(str);
		str.insert(2, "are all");
		System.out.println(str);
		int index = str.indexOf("Hello");
		str.replace(index, str.length(), "right");
		System.out.println(str);;
		return;
	}
}
